import React, { Component } from 'react'
import style from "../../assets/styles/model.module.css"

export default class Model extends Component {
    render() {
        const { title, visible } = this.props
        if (visible) {
            return (
                <div className={style.container}>
                    <div className={style.modelContent}>
                        <h3>{title || "标题"}</h3>
                        {this.props.children}
                        {/* 存放表单 */}
                        <button onClick={()=>this.props.close()}>关闭</button>
                    </div>
                </div>
            )
        } else {
            return null
        }
    }
}
